package com.ltmonitor.service.impl;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ltmonitor.dao.IMapAreaBindingDao;
import com.ltmonitor.entity.MapArea;
import com.ltmonitor.entity.MapAreaBinding;
import com.ltmonitor.service.IMapAreaBindingService;

@Service("mapAreaBindingService")
public class MapAreaBindingService extends BaseService<Long, MapAreaBinding> implements IMapAreaBindingService {

	@Autowired
	private IMapAreaBindingDao MapAreaBindingDao;
	
	
	public MapAreaBinding getMapAreaBinding(long mapAreaId, long vehicleId)
	{
		String hql = "from MapAreaBinding where areaId = ? and vehicleId = ?";

		MapAreaBinding eb = (MapAreaBinding) this.find(hql,
				new Object[] { mapAreaId, vehicleId });
		return eb;
	}
	
	public List<MapAreaBinding> getAllBinding(long vehicleId,
			String bindType) {
		String hql = "from MapAreaBinding where  vehicleId = ? and bindType = ?";

		List<MapAreaBinding> result =  this.query(hql, new Object[] {
				vehicleId,bindType });
		return result;
	}

	

}
